<?

define('INIT_TS', microtime(true));
define('SYSTEM_ROOT', PHLIGHT_PATH . '/lib');

mb_internal_encoding('utf-8');

class application
{
	protected static $environment;

	public static function init( $environment )
	{
		set_include_path(get_include_path() . PATH_SEPARATOR . SYSTEM_ROOT);
		self::$environment = $environment;
		
		require_once 'app/config.php';
		config::init();

		require_once 'error/handlers.php';

		require_once 'app/autoloader.php';
		require_once 'i18n/i18n.php';

		if ( config::get('debug') ) debug::timer_continue('Core init');
	}

	public static function get_env()
	{
		return self::$environment;
	}
}